package com.chookss.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * Company:
 * Project:
 * Author: liuhaoge
 * Date: 2021/1/27 9:30
 * Note:
 */
public class WrapContentListView extends ListView {
    public WrapContentListView(Context context) {
        super(context);
    }

    public WrapContentListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public WrapContentListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int maxHeight = (1 << 30) - 1;
        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST));
    }
}
